import java.util.Scanner;

class WordCntArray {
	public static void main(String[] args) {
		
		
		
		Scanner in = new Scanner(System.in);
		
		String line = in.nextLine();
		line = " " + line;
		int charCnt = 0;
		int position = 0;
		boolean count = false; 
		boolean halt = false;
		
		char[] charArray = new char[line.length()];
		
		charArray = line.toCharArray();
		
		
		if (line.length() > 1) {
			while (!halt){
				if (count) {
					charCnt++;
				}
				if (charArray[position] != ' ' & charArray[position + 1] == '.' ) {
					System.out.print(charCnt);
					halt = true;
				}
				if (charArray[position] != ' ' & charArray[position + 1] == ' ') {
					count = false;
					System.out.print(charCnt + " ");
					charCnt = 0;
				}
				
				if (charArray[position] == ' ' & charArray[position + 1] != ' ') {
					count = true;
				}
				position++;
			}
		}
		in.close();
	}
}